/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ControlGui;

import Chiabai_total.RotatedJLabel;
import heartnew.Card;
import java.util.Comparator;

/**
 *
 * @author DELL
 */
public class AscCard implements Comparator<Card>{
   @Override
    public int compare(Card o1, Card o2) {
        int rank1 = o1.getRank();
        int rank2 = o2.getRank();
        int num1=o1.getNumber();
        int num2=o2.getNumber();        
        if (rank1 < rank2) {
            return 1;
        }
        if (rank1 == rank2) {
             if (num1 < num2) {
                return 1;
            }
             else {
                return -1;
            }
        }
        return -1;
    }
}
